#include <stdio.h>
#include <assert.h>

int main(int argc, char* argv[]) {
	if (argc == 1) {
		printf("Usage: %s 0x00 0x11 0xff ...", argv[0]);
		return 0;
	}

	{
		FILE* pf;
		unsigned char* puc;
		int i;

		pf = fopen(".\\temp-file", "wb");
		assert(pf);

		puc = malloc(argc - 1);
		assert(puc);

		for (i = 0; i < argc - 1; ++i) {
			unsigned int tmp; // replace 'unsigned char tmp'
			sscanf(argv[i + 1], "%x", &tmp);
			*(puc + i) = tmp;
		}
		fwrite(puc, 1, argc - 1, pf);
		fclose(pf);
	}
	return 0;
}
